library("ggbio")
library(GenomicRanges)
data <- read.csv("IRN1000003263_TAIR10_12Sep2019_primary_targets.bed", header = FALSE,sep=" ",encoding="utf-8")
gr <- GRanges(seqnames = data$V1,
ranges = IRanges(start =data$V2,end = data$V3))
seqlengths(gr)=c(30427671,19698289,23459830,18585056,26975502)
circos <- GRanges(seqnames = c("chr1","chr2","chr3","chr4","chr5"),
ranges = IRanges(start =c(1,1,1,1,1),
end = c(30427671,19698289,23459830,18585056,26975502)),
temp=" ")
p <- ggbio() + circle(gr, geom = "rect", color = "steelblue",radius = 25) +
circle(circos, geom = "ideo", fill = "gray70",radius = 33) +
circle(circos, geom = "scale", size = 4,radius = 38) +
circle(circos, geom = "text", aes(label = seqnames), vjust = -2, size = 5,radius = 45)+
circle(circos, geom = "text", aes(label =temp), vjust = -2, size = 4,radius = 50)
jpeg(file="fig_a.jpg", width=5, height=5, units="in", res=800)
p
dev.off()
library(ggplot2)
data <- read.csv("IRN1000003263_TAIR10_12Sep2019_primary_targets.bed", header = FALSE,sep=" ",encoding="utf-8")
chr1=length(which(data$V1=="chr1"))
chr2=length(which(data$V1=="chr2"))
chr3=length(which(data$V1=="chr3"))
chr4=length(which(data$V1=="chr4"))
chr5=length(which(data$V1=="chr5"))
df<-data.frame(x=c("chr1","chr2","chr3","chr4","chr5"),y=c(chr1,chr2,chr3,chr4,chr5))
p <- df %>%
ggplot( aes(x=factor(x, level=x), y=y)) +
geom_bar(stat="identity", fill=c("#EE6666","#FAC858","#DA70D6","#5470C6","#73C0DE"),width=.6) +
ylab("Number of probes") +
xlab("Chromosome") +
theme_bw()+
theme(panel.border=element_blank(),axis.line=element_line(size=0.5,colour="black"))+
theme(plot.margin = unit(c(0, 0, 0, 0), "lines"),
axis.text.y=element_text(size=20),
axis.text.x = element_text(size=20),
axis.title.y=element_text(size=20),
axis.title.x = element_text(size=20),
panel.grid=element_blank())
jpeg(file="fig_b.jpg", width=5, height=5, units="in", res=800)
p
dev.off()